package com.power.sifa.std.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  被申请人类型实体类
*/

@Entity
@ApiModel(value="被申请人类型")
@Data
@Table(name="Std_tartype",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Std_tartype.Std_tartypePK.class) 用于复合组件
public class Std_tartype extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "名称")
    private String name;

    // 自定义属性, 引用类型id
    @Transient
    private String typeid = "0";


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("name", this.getName());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Std_tartypePK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Std_tartypePK pk = (Std_tartypePK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
